#ifndef  LIST_H
#define  LIST_H

#define    container_of(ptr,type,member)	\
	((type*)((char*)ptr - ((unsigned int)&((type*)0)->member)))
struct list
{
	struct list *next;
	struct list *prev;
};

static void list_insert_before(struct list *l,struct list *entry)
{
	l->next = entry;
	entry->prev->next = l;
	l->prev = entry->prev;
	entry->prev = l;
}

static void list_insert_after(struct list *l,struct list *entry)
{
	l->next = entry->next;
	l->prev = entry;
	l->next->prev = l;
	entry->next = l;
}

static void list_delete(struct list *p)
{
	p->prev->next = p->next;
	p->next->prev = p->prev;
}

#endif  /*LIST_H*/
